/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package main.Trees;

import com.primavera.common.value.ObjectId;
import com.primavera.integration.client.bo.object.ResourceAssignment;

import javax.swing.tree.DefaultMutableTreeNode;
import java.util.ArrayList;

/**
 *
 * @author me
 */
public class objectNode extends DefaultMutableTreeNode {
  private String name;
  private String Descr;
  private ObjectId objId;
  private ArrayList<ResourceAssignment> rsrc = new ArrayList<ResourceAssignment>();
  private Boolean isString;
  private Boolean isSmString;
  //private boolean isLeaf;
  
  public objectNode(){
    this.isSmString = false;
  }
  
  public objectNode(String name, String descr) {
    this.name = name;
    this.Descr = descr;
    this.isString = false;
    this.isSmString = false;
  }

  public objectNode(String name, String descr, ObjectId objId) {
    this.name = name;
    this.Descr = descr;
    this.objId = objId;
    this.isString = false;
    this.isSmString = false;
  }

  public objectNode(String name, String descr, ObjectId objId, Boolean isString) {
    this.name = name;
    this.Descr = descr;
    this.objId = objId;
    this.isString = isString;
    this.isSmString = false;
  }
  
  public String getDescr() {
    return Descr;
  }
  
  public void setDescr( String Descr) {
    this.Descr = Descr;
  }
  
  public ObjectId getObjId() {
    return objId;
  }
  
  public void setObjId( ObjectId objId) {
    this.objId = objId;
  }
    
  public String getName() {
    return name;
  }

  public void setName(String name) {
      this.name = name;
  }  
  
  public void setAllowChildren (Boolean val) { super.allowsChildren = val;} 
  
  public ArrayList<ResourceAssignment> getRsrc ()
  {
    return rsrc;
  }
  
  @Override
  public String toString() {
    return name;
  }
  
  public boolean isString() {
    return this.isString;
  }
  
  public boolean isSmString() { return this.isSmString; }
  
  public void setSmString(Boolean smString) { this.isSmString = smString; }
  
}
